package car;

import java.awt.*;

public class TextPanel {
        static void drawTextPanel(Graphics2D g2, String text, int x, int y) {
            FontMetrics fm = g2.getFontMetrics();
            int width = fm.stringWidth(text);
            int height = fm.getHeight();
            int newX = x - width / 2;
            int newY = y + height / 2;
            g2.drawString(text, newX, newY);
        }
}
